package com.voltbarn.vbsensors;
/*
import java.util.ArrayList;
import java.util.List;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import static com.voltbarn.vbsensors.BaseFeedParser.*;

public class RssHandler extends DefaultHandler{
	private List<Message> messages;
	private Message currentMessage;
	private StringBuilder builder;
	
	public List<Message> getMessages(){
		return this.messages;
	}
	@Override
	public void characters(char[] ch, int start, int length)
			throws SAXException {
		super.characters(ch, start, length);
		builder.append(ch, start, length);
	}

	@Override
	public void endElement(String uri, String localName, String name)
			throws SAXException {
		super.endElement(uri, localName, name);
		if (this.currentMessage != null){
			if (localName.equalsIgnoreCase(ID)){
				currentMessage.setID(builder.toString());
			} else if (localName.equalsIgnoreCase(LINK)){
				currentMessage.setLink(builder.toString());
			} else if (localName.equalsIgnoreCase(TEMP)){
				currentMessage.setTemperature(builder.toString());
			} else if (localName.equalsIgnoreCase(T0)){
				currentMessage.setTemp0(builder.toString());
			} else if (localName.equalsIgnoreCase(T1)){
				currentMessage.setTemp1(builder.toString());
			} else if (localName.equalsIgnoreCase(HUMIDITY)){
				currentMessage.setHumidity(builder.toString());
			} else if (localName.equalsIgnoreCase(PRESSURE)){
				currentMessage.setPressure(builder.toString());
			} else if (localName.equalsIgnoreCase(WINDS)){
				currentMessage.setWinds(builder.toString());
			} else if (localName.equalsIgnoreCase(DATE)){
				currentMessage.setDates(builder.toString());
			} 
			builder.setLength(0);	
		}
	}

	@Override
	public void startDocument() throws SAXException {
		super.startDocument();
		messages = new ArrayList<Message>();
		builder = new StringBuilder();
	}

	@Override
	public void startElement(String uri, String localName, String name,
			Attributes attributes) throws SAXException {
		super.startElement(uri, localName, name, attributes);
		if (localName.equalsIgnoreCase(CHANNEL)){
			this.currentMessage = new Message();
		}
	}
}
*/